Revert r41095, the bug is there because giving an error message as the return value...
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 21 Sep 2008 09:47:46 +0000 (09:47 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 21 Sep 2008 09:47:46 +0000 (09:47 +0000)
RELEASE-NOTES
includes/Article.php

index b8b6887..6d40652 100644 (file)
@@ -213,7 +213,6 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
   has been blocked more than 10 times. Patch by Matt Johnston.
 * (bug 12678) Skins don't show Upload link if the user isn't allowed to upload.
 * Fixed incorrect usage of DB_LAST in Special:Export. Deprecated DB_LAST.
-* 11119 {{grammar}} broken in noarticletext(anon) when ui lang != content lang
 
 === API changes in 1.14 ===
 
index cc40948..eeff834 100644 (file)
@@ -210,7 +210,7 @@ class Article {
         * @return Return the text of this revision
        */
        function getContent() {
-               global $wgOut, $wgMessageCache;
+               global $wgUser, $wgOut, $wgMessageCache;
 
                wfProfileIn( __METHOD__ );
 
@@ -220,11 +220,12 @@ class Article {
 
                        if ( $this->mTitle->getNamespace() == NS_MEDIAWIKI ) {
                                $wgMessageCache->loadAllMessages();
-                               $ret = wfMsgWeirdKey( $this->mTitle->getText() );
-                               return "<div class='noarticletext'>\n$ret\n</div>";
+                               $ret = wfMsgWeirdKey ( $this->mTitle->getText() ) ;
                        } else {
-                               return $this->getNoSuchPageText();
+                               $ret = wfMsg( $wgUser->isLoggedIn() ? 'noarticletext' : 'noarticletextanon' );
                        }
+
+                       return "<div class='noarticletext'>\n$ret\n</div>";
                } else {
                        $this->loadContent();
                        wfProfileOut( __METHOD__ );
@@ -232,20 +233,6 @@ class Article {
                }
        }
 
-       /*
-        * HACK HACK! We pre-parse them with parsemag to get GRAMMAR working right.
-        * It should be safe to do this and then do the full parse.
-        */
-       function getNoSuchPageText() {
-               global $wgUser;
-               if ( $wgUser->isLoggedIn() ) {
-                       $text = wfMsgExt( 'noarticletext', 'parsemag' );
-               } else {
-                       $text = wfMsgExt( 'noarticletextanon', 'parsemag' );
-               }
-               return "<div class='noarticletext'>\n$text\n</div>";
-       }
-
        /**
         * This function returns the text of a section, specified by a number ($section).
         * A section is text under a heading like == Heading == or \<h1\>Heading\</h1\>, or